.class Lcom/netease/newsreader/activity/NewsReader$32;
.super Ljava/lang/Thread;
.source "NewsReader.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/netease/newsreader/activity/NewsReader;->setHeaderPic(Ljava/util/Map;Landroid/widget/ImageView;Ljava/lang/String;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lcom/netease/newsreader/activity/NewsReader;

.field private final synthetic val$bitmapH:I

.field private final synthetic val$bitmapW:I

.field private final synthetic val$top_image:Landroid/widget/ImageView;

.field private final synthetic val$url:Ljava/lang/String;


# direct methods
.method constructor <init>(Lcom/netease/newsreader/activity/NewsReader;Landroid/widget/ImageView;Ljava/lang/String;II)V
    .locals 0
    .parameter
    .parameter
    .parameter
    .parameter
    .parameter

    .prologue
    .line 1
    iput-object p1, p0, Lcom/netease/newsreader/activity/NewsReader$32;->this$0:Lcom/netease/newsreader/activity/NewsReader;

    iput-object p2, p0, Lcom/netease/newsreader/activity/NewsReader$32;->val$top_image:Landroid/widget/ImageView;

    iput-object p3, p0, Lcom/netease/newsreader/activity/NewsReader$32;->val$url:Ljava/lang/String;

    iput p4, p0, Lcom/netease/newsreader/activity/NewsReader$32;->val$bitmapW:I

    iput p5, p0, Lcom/netease/newsreader/activity/NewsReader$32;->val$bitmapH:I

    .line 2239
    invoke-direct {p0}, Ljava/lang/Thread;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 14

    .prologue
    const/16 v13, 0xe

    .line 2242
    new-instance v6, Landroid/os/Message;

    invoke-direct {v6}, Landroid/os/Message;-><init>()V

    .line 2243
    .local v6, msg:Landroid/os/Message;
    iget-object v10, p0, Lcom/netease/newsreader/activity/NewsReader$32;->val$top_image:Landroid/widget/ImageView;

    iput-object v10, v6, Landroid/os/Message;->obj:Ljava/lang/Object;

    .line 2246
    :try_start_0
    iget-object v10, p0, Lcom/netease/newsreader/activity/NewsReader$32;->val$url:Ljava/lang/String;

    if-eqz v10, :cond_0

    iget-object v10, p0, Lcom/netease/newsreader/activity/NewsReader$32;->val$url:Ljava/lang/String;

    const-string v11, ""

    invoke-virtual {v10, v11}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v10

    if-eqz v10, :cond_1

    .line 2247
    :cond_0
    const/16 v10, 0xe

    iput v10, v6, Landroid/os/Message;->what:I

    .line 2248
    iget-object v10, p0, Lcom/netease/newsreader/activity/NewsReader$32;->this$0:Lcom/netease/newsreader/activity/NewsReader;

    invoke-static {v10}, Lcom/netease/newsreader/activity/NewsReader;->access$23(Lcom/netease/newsreader/activity/NewsReader;)Landroid/os/Handler;

    move-result-object v10

    invoke-virtual {v10, v6}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z

    .line 2300
    :goto_0
    return-void

    .line 2251
    :cond_1
    new-instance v4, Lorg/apache/http/params/BasicHttpParams;

    invoke-direct {v4}, Lorg/apache/http/params/BasicHttpParams;-><init>()V

    .line 2253
    .local v4, httpParams:Lorg/apache/http/params/HttpParams;
    const/16 v10, 0x7530

    invoke-static {v4, v10}, Lorg/apache/http/params/HttpConnectionParams;->setConnectionTimeout(Lorg/apache/http/params/HttpParams;I)V

    .line 2254
    const/16 v10, 0x7530

    invoke-static {v4, v10}, Lorg/apache/http/params/HttpConnectionParams;->setSoTimeout(Lorg/apache/http/params/HttpParams;I)V

    .line 2255
    invoke-static {v4}, Lcom/netease/newsreader/util/NeteaseHttpClient;->getHttpClient(Lorg/apache/http/params/HttpParams;)Lorg/apache/http/impl/client/DefaultHttpClient;

    move-result-object v3

    .line 2256
    .local v3, httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    iget-object v10, p0, Lcom/netease/newsreader/activity/NewsReader$32;->this$0:Lcom/netease/newsreader/activity/NewsReader;

    invoke-static {v10}, Lcom/netease/newsreader/util/Tools;->isCMWAPMobileNet(Landroid/content/Context;)Z

    move-result v10

    if-eqz v10, :cond_2

    .line 2257
    new-instance v7, Lorg/apache/http/HttpHost;

    const-string v10, "10.0.0.172"

    const/16 v11, 0x50

    const-string v12, "http"

    invoke-direct {v7, v10, v11, v12}, Lorg/apache/http/HttpHost;-><init>(Ljava/lang/String;ILjava/lang/String;)V

    .line 2258
    .local v7, proxy:Lorg/apache/http/HttpHost;
    invoke-virtual {v3}, Lorg/apache/http/impl/client/DefaultHttpClient;->getParams()Lorg/apache/http/params/HttpParams;

    move-result-object v10

    const-string v11, "http.route.default-proxy"

    invoke-interface {v10, v11, v7}, Lorg/apache/http/params/HttpParams;->setParameter(Ljava/lang/String;Ljava/lang/Object;)Lorg/apache/http/params/HttpParams;

    .line 2263
    .end local v7           #proxy:Lorg/apache/http/HttpHost;
    :goto_1
    new-instance v8, Lorg/apache/http/client/methods/HttpGet;

    iget-object v10, p0, Lcom/netease/newsreader/activity/NewsReader$32;->val$url:Ljava/lang/String;

    invoke-direct {v8, v10}, Lorg/apache/http/client/methods/HttpGet;-><init>(Ljava/lang/String;)V

    .line 2264
    .local v8, request:Lorg/apache/http/client/methods/HttpGet;
    invoke-virtual {v3, v8}, Lorg/apache/http/impl/client/DefaultHttpClient;->execute(Lorg/apache/http/client/methods/HttpUriRequest;)Lorg/apache/http/HttpResponse;

    move-result-object v9

    .line 2265
    .local v9, response:Lorg/apache/http/HttpResponse;
    invoke-interface {v9}, Lorg/apache/http/HttpResponse;->getEntity()Lorg/apache/http/HttpEntity;

    move-result-object v10

    invoke-interface {v10}, Lorg/apache/http/HttpEntity;->getContent()Ljava/io/InputStream;

    move-result-object v5

    .line 2267
    .local v5, is:Ljava/io/InputStream;
    if-nez v5, :cond_3

    .line 2268
    const/16 v10, 0xe

    iput v10, v6, Landroid/os/Message;->what:I

    .line 2269
    iget-object v10, p0, Lcom/netease/newsreader/activity/NewsReader$32;->this$0:Lcom/netease/newsreader/activity/NewsReader;

    invoke-static {v10}, Lcom/netease/newsreader/activity/NewsReader;->access$23(Lcom/netease/newsreader/activity/NewsReader;)Landroid/os/Handler;

    move-result-object v10

    invoke-virtual {v10, v6}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/OutOfMemoryError; {:try_start_0 .. :try_end_0} :catch_1

    goto :goto_0

    .line 2289
    .end local v3           #httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .end local v4           #httpParams:Lorg/apache/http/params/HttpParams;
    .end local v5           #is:Ljava/io/InputStream;
    .end local v8           #request:Lorg/apache/http/client/methods/HttpGet;
    .end local v9           #response:Lorg/apache/http/HttpResponse;
    :catch_0
    move-exception v2

    .line 2291
    .local v2, e:Ljava/lang/Exception;
    iput v13, v6, Landroid/os/Message;->what:I

    .line 2292
    iget-object v10, p0, Lcom/netease/newsreader/activity/NewsReader$32;->this$0:Lcom/netease/newsreader/activity/NewsReader;

    invoke-static {v10}, Lcom/netease/newsreader/activity/NewsReader;->access$23(Lcom/netease/newsreader/activity/NewsReader;)Landroid/os/Handler;

    move-result-object v10

    invoke-virtual {v10, v6}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z

    goto :goto_0

    .line 2260
    .end local v2           #e:Ljava/lang/Exception;
    .restart local v3       #httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .restart local v4       #httpParams:Lorg/apache/http/params/HttpParams;
    :cond_2
    :try_start_1
    invoke-virtual {v3}, Lorg/apache/http/impl/client/DefaultHttpClient;->getParams()Lorg/apache/http/params/HttpParams;

    move-result-object v10

    const-string v11, "http.route.default-proxy"

    invoke-interface {v10, v11}, Lorg/apache/http/params/HttpParams;->removeParameter(Ljava/lang/String;)Z
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
    .catch Ljava/lang/OutOfMemoryError; {:try_start_1 .. :try_end_1} :catch_1

    goto :goto_1

    .line 2294
    .end local v3           #httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .end local v4           #httpParams:Lorg/apache/http/params/HttpParams;
    :catch_1
    move-exception v2

    .line 2295
    .local v2, e:Ljava/lang/OutOfMemoryError;
    iput v13, v6, Landroid/os/Message;->what:I

    .line 2296
    iget-object v10, p0, Lcom/netease/newsreader/activity/NewsReader$32;->this$0:Lcom/netease/newsreader/activity/NewsReader;

    invoke-static {v10}, Lcom/netease/newsreader/activity/NewsReader;->access$23(Lcom/netease/newsreader/activity/NewsReader;)Landroid/os/Handler;

    move-result-object v10

    invoke-virtual {v10, v6}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z

    goto :goto_0

    .line 2271
    .end local v2           #e:Ljava/lang/OutOfMemoryError;
    .restart local v3       #httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .restart local v4       #httpParams:Lorg/apache/http/params/HttpParams;
    .restart local v5       #is:Ljava/io/InputStream;
    .restart local v8       #request:Lorg/apache/http/client/methods/HttpGet;
    .restart local v9       #response:Lorg/apache/http/HttpResponse;
    :cond_3
    :try_start_2
    new-instance v10, Lcom/netease/newsreader/util/BaseImageDownloader$FlushedInputStream;

    invoke-direct {v10, v5}, Lcom/netease/newsreader/util/BaseImageDownloader$FlushedInputStream;-><init>(Ljava/io/InputStream;)V

    invoke-static {v10}, Landroid/graphics/BitmapFactory;->decodeStream(Ljava/io/InputStream;)Landroid/graphics/Bitmap;

    move-result-object v10

    iget v11, p0, Lcom/netease/newsreader/activity/NewsReader$32;->val$bitmapW:I

    iget v12, p0, Lcom/netease/newsreader/activity/NewsReader$32;->val$bitmapH:I

    invoke-static {v10, v11, v12}, Lcom/netease/newsreader/util/PicUtil;->cutBitmap(Landroid/graphics/Bitmap;II)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 2272
    .local v0, bm:Landroid/graphics/Bitmap;
    if-eqz v0, :cond_4

    .line 2273
    iget-object v10, p0, Lcom/netease/newsreader/activity/NewsReader$32;->val$url:Ljava/lang/String;

    iget-object v11, p0, Lcom/netease/newsreader/activity/NewsReader$32;->val$url:Ljava/lang/String;

    const-string v12, "/"

    invoke-virtual {v11, v12}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v11

    add-int/lit8 v11, v11, 0x1

    iget-object v12, p0, Lcom/netease/newsreader/activity/NewsReader$32;->val$url:Ljava/lang/String;

    invoke-virtual {v12}, Ljava/lang/String;->length()I

    move-result v12

    invoke-virtual {v10, v11, v12}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v10

    invoke-static {v10, v0}, Lcom/netease/newsreader/util/PicUtil;->saveMyBitmap(Ljava/lang/String;Landroid/graphics/Bitmap;)Z

    .line 2274
    const/16 v10, 0xf

    iput v10, v6, Landroid/os/Message;->what:I

    .line 2275
    new-instance v1, Landroid/os/Bundle;

    invoke-direct {v1}, Landroid/os/Bundle;-><init>()V

    .line 2276
    .local v1, bundle:Landroid/os/Bundle;
    const-string v10, "headpic"

    invoke-virtual {v1, v10, v0}, Landroid/os/Bundle;->putParcelable(Ljava/lang/String;Landroid/os/Parcelable;)V

    .line 2277
    invoke-virtual {v6, v1}, Landroid/os/Message;->setData(Landroid/os/Bundle;)V

    .line 2278
    iget-object v10, p0, Lcom/netease/newsreader/activity/NewsReader$32;->this$0:Lcom/netease/newsreader/activity/NewsReader;

    invoke-static {v10}, Lcom/netease/newsreader/activity/NewsReader;->access$23(Lcom/netease/newsreader/activity/NewsReader;)Landroid/os/Handler;

    move-result-object v10

    invoke-virtual {v10, v6}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z

    .line 2284
    .end local v1           #bundle:Landroid/os/Bundle;
    :goto_2
    invoke-virtual {v5}, Ljava/io/InputStream;->close()V

    goto/16 :goto_0

    .line 2280
    :cond_4
    const/16 v10, 0xe

    iput v10, v6, Landroid/os/Message;->what:I

    .line 2281
    iget-object v10, p0, Lcom/netease/newsreader/activity/NewsReader$32;->this$0:Lcom/netease/newsreader/activity/NewsReader;

    invoke-static {v10}, Lcom/netease/newsreader/activity/NewsReader;->access$23(Lcom/netease/newsreader/activity/NewsReader;)Landroid/os/Handler;

    move-result-object v10

    invoke-virtual {v10, v6}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0
    .catch Ljava/lang/OutOfMemoryError; {:try_start_2 .. :try_end_2} :catch_1

    goto :goto_2
.end method
